<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ page import = "jdbc.*" %>
<%@ page import = "java.util.*" %>
<%@ page import = "java.text.SimpleDateFormat" %>
<%@ page import = "java.util.Date" %>
<!DOCTYPE html>
<html lang="en">
     <head>
     <title>信息</title>
     <meta charset="utf-8">
     <meta name = "format-detection" content = "telephone=no" />
     <link rel="icon" href="images/favicon.ico" type="image/x-icon">
     <link rel="stylesheet" href="css/style.css">
     <link rel="stylesheet" href="css/font-awesome.min.css">
     <link rel="stylesheet" href="css/stuck.css">
     <link rel="stylesheet" href="css/jquery.fancybox-1.3.4.css">
     <script src="js/jquery-1.11.1.min.js"></script>
     <script src="js/jquery-migrate-1.2.1.js"></script>
     <script src="js/jquery.easing.1.3.js"></script>
     <script src="js/jquery.ui.totop.js"></script>
     <script src="js/jquery.equalheights.js"></script>
	 <script src="js/script.js"></script>
     <script src="js/superfish.js"></script>
     <script src="js/jquery.mobilemenu.js"></script>
     <script src="js/tmStickUp.js"></script>
     <script src="js/jquery.fancybox-1.3.4.js"></script>
     <script>       
       $(document).ready(function(){
          $("a.various").fancybox();
       }) 
     </script>
     <!--[if lt IE 8]>
       <div style=' clear: both; text-align:center; position: relative;'>
         <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
           <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
         </a>
      </div>
    <![endif]-->
    <!--[if lt IE 9]>
   		<script src="js/html5shiv.js"></script>
    	<link rel="stylesheet" type="text/css" media="screen" href="css/ie.css">
    <![endif]-->
     </head>
     <body>


<!--======= Header ================================-->
	<%@ include file = "./header.jsp" %>

<!--======= Content ================================-->

<%

JdbcDao mysql = new JdbcDao();
List<HashMap<String, String>> as1 = mysql.searchArticleByTag("公告活动");
List<HashMap<String, String>> as2 = mysql.searchArticleByTag("视频资源");
List<HashMap<String, String>> as3 = mysql.searchArticleByTag("信息汇总");


%>

<style>

.myheight {
overflow: hidden;
height: 300px;
}

.video_video {
overflow: hidden;
}

.teaser_post img {
display: none;
}
.teaser_post video {
display: none;
}
.insert_here img {
width: 295px;
height: auto;
float: left;
margin-right: 26px;
}
.readmore {
float: right;
margin-top: 10px;
}
</style>
<script>

$(document).ready(function() {
	var posts = $(".teaser");
	for (var i=0; i<posts.length; i++) {
		var post = posts.eq(i);
		var vd = post.find("video");
		var ins = post.find(".insert_here");
		if (vd.length>0) {
			vd = vd.eq(0);
			//alert(vd.attr("src"));
			vd.attr("preload", "auto");
			ins.append(vd);
			continue;
		}
		var img = post.find("img");
		if (img.length>0) {
			img = img.eq(0);
			//alert(img.attr("src"));
			ins.append(img);
		}
	}
});

</script>

<!--======= Info Horizontal =======-->
<div class="content info-hor">
    <div class="container">
        <h3 class="totag"><a>公告活动</a></h3>
        <ul class="row">
            <%
            
            for (int i=0; i<as1.size(); i++) {
            	if (i >= 4) break;
            	HashMap<String, String> as = as1.get(i);
            %>
            <li class="grid_6">
                <div class="box">
                    <div class="myheight">
                        <div class="info-hor_block teaser">
                            <a class="insert_here" href="./article.jsp?aid=<%= as.get("articleid") %>"></a>
                            <div class="info-hor_text teaser_post">
                                <h4><a href="./article.jsp?aid=<%= as.get("articleid") %>"><%= as.get("title") %></a></h4>
                                <p class="p__indent-1">
                                <%= as.get("content") %>
                                </p>
                            </div>
                        </div>
                    </div>
                                <a href="./article.jsp?aid=<%= as.get("articleid") %>" class="link readmore">
                                    <span class="link_text">Read More</span>
                                    <span class="link_arrow">>></span>
                                </a>
                </div>
            </li>
            
            <% } %>
        </ul>
    </div>
</div>

<!--======= Video & List =======-->
<div class="content content__indent">
    <div class="container">
        <div class="row">
            <div class="grid_8 video">
                <h3 class="totag"><a>视频资源</a></h3>
            <%
            
            for (int i=0; i<as2.size(); i++) {
            	if (i >= 2) break;
            	HashMap<String, String> as = as2.get(i);
            %>
                <div class="video_block teaser">
                    <div class="row">
                        <div class="grid_4">
                            <div class="video_video">
                                 <a class="insert_here">
                                    <div class="video-hover"><i class="fa fa-play-circle"></i></div>
                                </a>
                            </div>
                        </div>
                        <div class="grid_4">
                            <div class="video_text teaser_post">
                                <h4><a href="./article.jsp?aid=<%= as.get("articleid") %>"><%= as.get("title") %></a></h4>
                                <p class="p__indent-1"></p>
                                <div><%=as.get("content") %></div>
                            </div>
                        </div>
                    </div>
                </div>
            <% } %>
            </div>
            <div class="grid_4 list">                
        	<h3 class="totag"><a>信息汇总</a></h3>
                <ul>
            <%
            
            for (int i=0; i<as3.size(); i++) {
            	if (i >= 9) break;
            	HashMap<String, String> as = as3.get(i);
            %>
                    <li><a href="./article.jsp?aid=<%= as.get("articleid") %>"><%= as.get("title") %></a></li>
            <% } %>
                </ul>
            </div>
        </div>
    </div>
</div>


<!--======= Footer =================================-->

<!--======= To Top Button =================================-->

<%@ include file = "./footer.jsp" %>

</body>
</html>